export default {
    mounted(el, binding, vnode, prevVnode) {
        el.addEventListener('click', (e) => {
            el.disabled = true
            let timer = 60
            el.style = 'background: linear-gradient(to bottom right, #ddd, #f8f8f8);'
            setTimeout(() => {
                el.style = ''
            }, 200)
            el.innerHTML = `${timer}秒后获取`
            let set = setInterval(() => {
                el.innerHTML = `${timer < 10 ? '0' + timer : timer}秒后获取`
                timer--
                if (timer == 0) {
                    clearInterval(set)
                    el.disabled = false
                    el.innerHTML = `获取验证码`
                }
            }, 1000);
        });
    },
}

